{% extends 'base.html' %}
{% block title %}Hello, World!{% endblock %}
{% block head_scripts %}
eel.expose(say_hello_js); // Expose this function to Python
function say_hello_js(x) {
console.log("Hello from " + x);
}
eel.expose(js_random);
function js_random() {
return Math.random();
}
function print_num(n) {
console.log('Got this from Python: ' + n);
}
eel.py_random()(print_num);
say_hello_js("Javascript World!");
eel.say_hello_py("Javascript World!"); // Call a Python function
{% endblock %}
{% block content %}
Hello, World!
Page 2
{% endblock %}